import { Component } from '@angular/core';
import { NavParams } from 'ionic-angular';

@Component({
	template: `
	<div>
		<h4>{{ title }}</h4>
		<div class="progress-bg">
			<div class="progress-fg" [style.width]="progress+'%'"></div>
		</div>
	</div>
	`
})
export default class ProgressPage {
	private progress: number = 0;
	private title: string = "Loading...";
	constructor(private params: NavParams) {
		params.data.setCallback(this.callback.bind(this));
		this.title = params.data.title || this.title;
	}
	callback(info) {
		console.log(info);
		this.progress = info.percent;
	}
}
